
      
<h1 class="mume-header" id="go%E8%AF%AD%E8%A8%80%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AEvscode">Go&#x8BED;&#x8A00;&#x5F00;&#x53D1;&#x73AF;&#x5883;&#x914D;&#x7F6E;(VSCode)</h1>

<p>&#x914D;&#x7F6E;Go&#x8BED;&#x8A00;&#x65F6;&#x9047;&#x5230;&#x4E00;&#x4E9B;&#x5751;&#xFF0C;&#x7279;&#x522B;&#x662F;VSCode&#x4E2D;Go&#x5DE5;&#x5177;<strong>&#x5305;&#x7684;&#x5B89;&#x88C5;</strong>&#x53CA;&#x76F8;&#x5173;&#x7684;<strong>&#x79D1;&#x5B66;&#x4E0A;&#x7F51;</strong>&#x77E5;&#x8BC6;&#xFF0C;&#x67E5;&#x4E86;&#x5F88;&#x591A;&#x8D44;&#x6599;&#x90FD;&#x63CF;&#x8FF0;&#x4E0D;&#x6E05;&#x6670;&#xFF0C;&#x53EF;&#x80FD;&#x662F;&#x6211;&#x8BA4;&#x4E3A;&#x662F;&#x96BE;&#x70B9;&#x7684;&#x5185;&#x5BB9;&#x5728;&#x522B;&#x4EBA;&#x90A3;&#x91CC;&#x662F;&#x4E0D;&#x9700;&#x8981;&#x8BF4;&#x660E;&#x7684;&#x57FA;&#x7840;&#x5427;&#x3002;</p>
<p>&#x5176;&#x5B9E;&#x53EA;&#x8981;&#x79D1;&#x5B66;&#x4E0A;&#x7F51;&#x914D;&#x7F6E;&#x5B8C;&#x6210;&#xFF0C;VSCode&#x4E2D;&#x5B89;&#x88C5;&#x5DE5;&#x5177;&#x5305;&#x8D85;&#x7EA7;&#x7B80;&#x5355;&#xFF0C;&#x5BF9;&#xFF0C;&#x662F;&#x8D85;&#x7EA7;&#x7B80;&#x5355;&#x3002;&#x597D;&#x50CF;&#x672C;&#x6587;&#x6807;&#x9898;&#x4E0D;&#x5BF9;&#xFF1F;&#x5E94;&#x8BE5;&#x53EB;&#x201C;Go&#x8BED;&#x8A00;&#x5DE5;&#x5177;&#x5305;&#x5B89;&#x88C5;&#x201D;&#xFF1F;&#x597D;&#x5427;&#xFF0C;&#x6211;&#x5728;&#x8FD9;&#x91CC;&#x662F;&#x628A;Go&#x7684;&#x73AF;&#x5883;&#x53D8;&#x91CF;&#x7B49;&#x914D;&#x7F6E;&#x5F53;&#x4F5C;&#x4E0D;&#x9700;&#x8981;&#x8BF4;&#x660E;&#x7684;&#x57FA;&#x7840;&#x4E86;&#xFF0C;&#x90A3;&#x4E9B;&#x4E1C;&#x4E1C;&#x7F51;&#x4E0A;&#x5F88;&#x591A;&#xFF0C;&#x6211;&#x5728;&#x672C;&#x6587;&#x7565;&#x8FC7;&#x4E86;:)</p>
<h4 class="mume-header" id="%E5%AE%89%E8%A3%85go">&#x5B89;&#x88C5;go</h4>

<p>&#x7565;</p>
<h4 class="mume-header" id="%E5%AE%89%E8%A3%85git">&#x5B89;&#x88C5;git</h4>

<p>&#x7565;</p>
<h4 class="mume-header" id="vs-code%E9%85%8D%E7%BD%AE">VS Code&#x914D;&#x7F6E;</h4>

<ul>
<li>
<p>1.&#x5B89;&#x88C5;go&#x6269;&#x5C55;<br>
&#x5728;vscode&#x6269;&#x5C55;&#x4E2D;&#x641C;&#x201C;go&#x201D;,&#x9009;&#x62E9;microsoft&#x5B98;&#x65B9;&#x7684;ms-vscode.go</p>
</li>
<li>
<p>2.&#x5B89;&#x88C5;&#x76F8;&#x5173;&#x5DE5;&#x5177;&#x5305;</p>
<ul>
<li>&#x901A;&#x8FC7;VSCode&#x5B89;&#x88C5;<br>
&#x64CD;&#x4F5C;&#x5F88;&#x7B80;&#x5355;&#xFF0C;&#x4F46;&#x9700;&#x8981;&#x79D1;&#x5B66;&#x4E0A;&#x7F51;&#xFF08;&#x89C1;&#x4E0B;&#x9762;&#x7B2C;4&#x6761;&#xFF09;
<ul>
<li>
<p>1)Ctrl + Shift + P</p>
</li>
<li>
<p>2)&#x8F93;&#x5165;<code>Go: install/update tools</code></p>
</li>
<li>
<p>3)All Select,&#x786E;&#x5B9A;</p>
</li>
<li>
<p>4)&#x90E8;&#x5206;&#x5DE5;&#x5177;&#x9700;&#x8981;&#x79D1;&#x5B66;&#x4E0A;&#x7F51;&#x3002;&#x6CE8;&#x610F;&#x4E3A;VSCode&#x8BBE;&#x7F6E;[&#x7528;&#x6237;&#x8BBE;&#x7F6E;]http&#x4EE3;&#x7406;:<br>
&#x6B64;&#x5904;&#x4EE5;SSR&#x4E3A;&#x4F8B;&#xFF0C;&#x8BF7;&#x5148;&#x5B89;&#x88C5;&#x5E76;&#x5B8C;&#x6210;SSR&#x5BA2;&#x6237;&#x7AEF;&#x914D;&#x7F6E;</p>
<ul>
<li>4.1) windows&#x4E0B;&#x5148;&#x542F;&#x52A8;SSR&#x5BA2;&#x6237;&#x7AEF;&#xFF0C;&#x518D;&#x5BF9;VSCode&#x8BBE;&#x7F6E;&#xFF1A;</li>
</ul>
<pre data-role="codeBlock" data-info="json" class="language-json"><span class="token property">&quot;http.proxy&quot;</span><span class="token operator">:</span> <span class="token string">&quot;127.0.0.1:1080&quot;</span><span class="token punctuation">,</span>  
</pre><ul>
<li>4.2) linux&#x4E0B;&#x9700;&#x8981;<a href="https://www.cnblogs.com/liuxuzzz/p/5324749.html">&#x4F7F;&#x7528;privoxy</a>&#x4E00;&#x7C7B;&#x7684;&#x5DE5;&#x5177;&#xFF0C;&#x5B89;&#x88C5;&#x914D;&#x7F6E;&#x597D;privoxy&#x4E4B;&#x540E;&#xFF0C;&#x518D;&#x8BBE;&#x7F6E;VSCode</li>
</ul>
<pre data-role="codeBlock" data-info="json" class="language-json"><span class="token property">&quot;http.proxy&quot;</span><span class="token operator">:</span> <span class="token string">&quot;http://localhost:8118/&quot;</span><span class="token punctuation">,</span>  
</pre><pre data-role="codeBlock" data-info="javascript" class="language-javascript"><span class="token keyword">if</span> <span class="token punctuation">(</span>a <span class="token operator">==</span> b<span class="token punctuation">)</span> <span class="token punctuation">{</span>
  	   <span class="token keyword">var</span> c <span class="token operator">=</span> <span class="token string">&quot;21&quot;</span><span class="token punctuation">;</span>
  	<span class="token punctuation">}</span>
</pre><pre data-role="codeBlock" data-info="go" class="language-go"><span class="token keyword">if</span> a <span class="token operator">==</span> b <span class="token punctuation">{</span>
  	   <span class="token keyword">var</span> c <span class="token operator">=</span> <span class="token string">&quot;21&quot;</span><span class="token punctuation">;</span>
  	<span class="token punctuation">}</span>
</pre><p>&#x6CE8;&#xFF1A;&#x56E0;&#x4E3A;&#x8981;&#x8DD1;&#x672C;&#x5730;&#x670D;&#x52A1;&#xFF0C;&#x56E0;&#x6B64;&#x9700;&#x8981;&#x53BB;&#x6389;Privoxy/config&#x4E2D;<code># forward localhost/ .</code>&#x6CE8;&#x91CA;</p>
<pre data-role="codeBlock" data-info="shell" class="language-shell">forward           localhost/     <span class="token keyword">.</span>  
</pre></li>
</ul>
</li>
<li>&#x624B;&#x52A8;&#x5B89;&#x88C5;
<ul>
<li>&#x4F7F;&#x7528;go get&#xFF0C;&#x4F8B;&#x5982;&#xFF1A;<pre data-role="codeBlock" data-info="shell" class="language-shell">go get -u github.com/gin-gonic/gin  
</pre>&#x90E8;&#x5206;&#x5305;&#x9700;&#x8981;&#x79D1;&#x5B66;&#x4E0A;&#x7F51;&#xFF0C;&#x53EF;&#x53C2;&#x8003;&#x524D;&#x9762;&#x79D1;&#x5B66;&#x4E0A;&#x7F51;&#x8BF4;&#x660E;</li>
<li>&#x4E0D;&#x60F3;&#x7FFB;&#x5899;&#x7684;&#x5B89;&#x88C5;&#x65B9;&#x6CD5;<pre data-role="codeBlock" data-info="shell" class="language-shell"><span class="token comment"># &#x6CE8;&#x610F;&#xFF0C;github&#x4E0B;golang/&#x955C;&#x50CF;&#x4E2D;&#x7684;&#x5305;&#x9700;&#x8981;&#x653E;&#x5230;golang.org/x&#x76EE;&#x5F55;&#x4E0B;  </span>
<span class="token function">git</span> clone https://github.com/golang/net.git <span class="token variable">$GOPATH</span>/src/golang.org/x/net  
<span class="token function">git</span> clone https://github.com/golang/sys.git <span class="token variable">$GOPATH</span>/src/golang.org/x/sys  
<span class="token function">git</span> clone https://github.com/golang/tools.git <span class="token variable">$GOPATH</span>/src/golang.org/x/tools  
</pre></li>
</ul>
</li>
</ul>
</li>
<li>
<p>3.&#x914D;&#x7F6E;</p>
<ul>
<li>&#x8BBE;&#x7F6E;toolsGopath(&#x539F;&#x56E0;&#x53C2;&#x8003;<a href="https://blog.csdn.net/ys5773477/article/details/78881841">vscode golang&#x8BE6;&#x7EC6;&#x914D;&#x7F6E;</a>&#x4E2D;&#x7684;&#x3010;<strong>&#x6CE8;&#xFF1A;&#x5751;&#x70B9;</strong>&#x3011;)<br>
&#x5728;VSCode[&#x7528;&#x6237;&#x8BBE;&#x7F6E;]&#x4E2D;&#x6DFB;&#x52A0;&#xFF1A;<pre data-role="codeBlock" data-info="json" class="language-json"><span class="token property">&quot;go.toolsGopath&quot;</span><span class="token operator">:</span> <span class="token string">&quot;F:\\SourceCode\\go&quot;</span><span class="token punctuation">,</span>  
</pre></li>
<li>debug&#x914D;&#x7F6E;<br>
&#x4F7F;&#x7528;&#x9ED8;&#x8BA4;&#x914D;&#x7F6E;<br>
debug&#x914D;&#x7F6E;&#x7684;&#x66F4;&#x591A;&#x4FE1;&#x606F;&#xFF0C;&#x53C2;&#x8003;&#x5B98;&#x65B9;Wiki&#xFF1A; <a href="https://github.com/Microsoft/vscode-go/wiki/Debugging-Go-code-using-VS-Code">Debugging Go code using VS Code</a></li>
</ul>
</li>
</ul>

      